package com.yedean.mall.portal.config;

import com.yedean.mall.portal.client.DefaultWxClient;
import com.yedean.mall.portal.client.WxClient;
import com.yedean.mall.portal.client.WxProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author yedean
 * @date 2022/4/1 9:14
 */
@Configuration
@EnableConfigurationProperties(value = {WxProperties.class})
public class WxConfig {
    @Bean
    public WxClient wxClient(WxProperties properties, RestTemplate restTemplate) {
        return new DefaultWxClient(restTemplate, properties);
    }
}
